package cn.com.chengq.model;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class Teacher {
    /**
     * 获取外部属性配置中的值
     */
    @Value("${name}")
    private String name;

    private int age;

    @Value("${age}")
    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Teacher{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
